<!DOCTYPE html>
<head>
<?php include_once VIEWS.'inc/head.php'; ?>
</head>

<body>
	<div id="back-top"></div>
    <?php include_once VIEWS.'inc/header.php'; ?>
<?php include_once VIEWS.'inc/right.php'; ?>

	
	<div class="w1680 service-banner shadow2">
		
		<img src="<?php echo UPLOAD_URL.tag_photo(tag_single(19,"photo"));?>">
		
	</div>

	<div class="w1680 service-first shadow bc">
		<div class="w1190 service-top">
			<div class="fl service-top-left">
				<div class="en-title">SERVICE</div>
				<div class="ch-title">服务支持</div>
			</div>

			<div class="fr service-top-right">
				<a href="<?php echo site_url('services/index'); ?>"><div class="fl service-s ">客户服务</div></a>
				<a href="<?php echo site_url('services/faq'); ?>"><div class="fl service-q act">常见问题</div></a>
				<a href="<?php echo site_url('services/repair'); ?>"><div class="fl service-f">产品维修</div></a>
			</div>
		</div>
	</div>
	
	<div class="w1680 faq-second shadow js-ajax-box">
	<?php if(!empty($fenye['new_con'])):?>
  <?php foreach($fenye['new_con'] as $k=>$v):?>
		<div class="w1190 faq-frame">
			<div class="faq-title">Q：<?php echo $v['title'];?></div>
			<div class="faq-wrap">
				<div class="fl faq-text">
					<?php echo $v['answer'];?>
				</div>
				<div class="fr faq-more"></div>
				<div class="fr faq-less"></div>
			</div>
		</div>
	<?php endforeach;?>
  <?php endif;?>

		<div class="loading"></div>

	</div>

	<div class="pi-back"></div>

    <?php include_once VIEWS.'inc/footer.php'; ?>
<?php
	echo static_file('web/js/main.js');
?>
</body>
</html>
<script type="text/javascript">
$(function(){
	
	$(document).on('click','.faq-more',function(){
    // $(".faq-frame .faq-wrap").find(".faq-more").click(function(){
    	var fw=$(this).parent('.faq-wrap');
    	var ft=$(this).parent('.faq-wrap').find('.faq-text');
        var fm=$(this);
        var fl=$(this).next('.faq-less');
        fw.css({
        	height: 'auto',
        	overflow: ''
        });
        ft.css({
			height: 'auto',
			overflow: '',
			textOverflow: '',
			whiteSpace: 'normal'
		});
		fm.hide();
		fl.show();
	});
	
	$(document).on('click','.faq-less',function(){
	// $(".faq-frame .faq-wrap").find(".faq-less").click(function(){
    	var fw=$(this).parent('.faq-wrap');
    	var ft=$(this).parent('.faq-wrap').find('.faq-text');
        var fm=$(this).parent('.faq-wrap').find(".faq-more");
        var fl=$(this);
        fw.css({
        	height: '30px',
        	overflow: 'hidden'
        });
        ft.css({
			height: '30px',
			overflow: 'hidden',
			textOverflow: 'ellipsis',
			whiteSpace: 'nowrap'
		});
		fl.hide();
		fm.show();
	});

	var NewUrl = '<?php echo site_url('services/faq_ajax');?>';
	var p = 1;
	$(window).scroll(function(){
		if ($(document).height() - $(this).scrollTop() - $(this).height()<1){
		//if($(document).scrollTop()>=$(document).height()-$(window).height()-180){
		    $.ajax({
		        type:"GET",
		        url:NewUrl,
		        data: { page: p+1},
	          cache: false,
		        dataType:'json',
		        beforeSend:function(){
		          $('.loading').show(); //显示加载时候的提示
		        },
		        success:function(data){
		        			 if(data.status=='yes'){
                    p=p+1;
                   }else{
                	   $(window).off("scroll");
                	   $('.loading').hide();//请求成功,隐藏加载提示
                   }
		        	$('.js-ajax-box').append(data.list);
		         
		         	 
		        }
		    })
	  	}
	});
	

})
</script>